package com.xialinrui.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xialinrui.dto.DailyAcquirementDto;
import com.xialinrui.dto.MonthlyAcquirementDto;
import com.xialinrui.dto.YearlyAcquirementDto;
import com.xialinrui.entity.Acquirement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xialinrui
 */
@Mapper
@Repository
public interface AcquirementMapper extends BaseMapper<Acquirement> {
    void increaseAcquire(@Param("todo_id") Long todoId, @Param("affair_id") Long affairId);

    Double getMoneyNumbersToday(@Param("affair_id") Long affairId);

    Integer getLoveNumbersToday(@Param("affair_id") Long affairId);

    void decreaseAcquire(@Param("todo_id") Long id);

    void addAcquireByAffairIdAndTime(@Param("affair_id") Long id, @Param("real_time") Integer realTime);

    Integer getDailyStudyTime(@Param("affair_id") Long affairId);

    void updateDailyTime(@Param("affair_id") Long affairId, @Param("real_time") Integer realTime);


    List<MonthlyAcquirementDto> thingsMonthly(@Param("from") String from,@Param("to") String to);

    List<DailyAcquirementDto> thingsDaily(@Param("from") String from,@Param("to") String to);

    List<YearlyAcquirementDto> thingsYearly(@Param("from") String from,@Param("to") String to);
}
